export enum E2LProtocol {
    e2l_click_logo = "e2l_click_logo",
    e2l_click_login = "e2l_click_login",
    e2l_enter_stage = "e2l_enter_stage",
    e2l_target_destroy = "e2l_target_destroy",
    e2l_target_killed = "e2l_target_killed",
    e2l_target_boom = "e2l_target_boom",
    e2l_valid_bullet = "e2l_valid_bullet",
    e2l_buy_gun = "e2l_buy_gun",
    e2l_pop_coin = "e2l_pop_coin",
    e2l_read_configs = "e2l_read_configs",
    e2l_group_ratory = "e2l_group_ratory",
    e2l_update_qq_user = "e2l_update_qq_user",
    e2l_add_level_task = "e2l_add_level_task",
    e2l_pop_pmd = "e2l_pop_pmd",
}

export enum L2EProtocol {
    l2e_check_qq_login = "l2e_check_qq_login",
    l2e_show_login = "l2e_show_login",
    l2e_create_target = "l2e_create_target",
    l2e_fire_gun = "l2e_fire_gun",
    l2e_check_bullet = "l2e_check_bullet",
    l2e_reload_bullet = "l2e_reload_bullet",
    l2e_login = "l2e_login",
    l2e_sync_info = "l2e_sync_info",
    l2e_buy_gun = "l2e_buy_gun",
    l2e_select_gun = "l2e_select_gun",
    l2e_auto_select_gun = "l2e_auto_select_gun",
    l2e_release_gun = "l2e_release_gun",
    l2e_sell_gun = "l2e_sell_gun",
    l2e_exchange_pos = "l2e_exchange_pos",
    l2e_composite_gun = "l2e_composite_gun",
    l2e_change_weapon = "l2e_change_weapon",
    l2e_composite_gold = "l2e_composite_gold",
    l2e_upd_gold_guns = "l2e_upd_gold_guns",
    l2e_upd_one_siteguns = "l2e_upd_one_siteguns",
    l2e_upd_popcoin_speed = "l2e_upd_popcoin_speed",
    l2e_update_coin = "l2e_update_coin",
    l2e_update_diamonds = "l2e_update_diamonds",
    l2e_update_pdg = "l2e_update_pdg",
    l2e_close_task = "l2e_close_task",
    l2e_consume_rotary = "l2e_consume_rotary",
    l2e_7day_pri = "l2e_7day_pri",
    l2e_shop_finishad = "l2e_shop_finishad",
    l2e_enter_stage = "l2e_enter_stage",
    l2e_stage_result = "l2e_stage_result",
    l2e_update_mult = "l2e_update_mult",
    l2e_update_willbuy = "l2e_update_willbuy",
    l2e_start_auto_comp = "l2e_start_auto_comp",
    l2e_mail_prize = "l2e_mail_prize",
    l2e_update_rotarycount = "l2e_update_rotarycount",
    l2e_stage_double_rew = "l2e_stage_double_rew",
    l2e_free_coin = "l2e_free_coin",
    l2e_pop_offline = "l2e_pop_offline",
    l2e_refresh_rank = "l2e_refresh_rank",
    l2e_update_trmb = "l2e_update_trmb",
    l2e_update_rmb = "l2e_update_rmb",
    l2e_update_minTRMB = "l2e_update_minTRMB",
    l2e_list_task = "l2e_list_task",
    l2e_refresh_level_trmb = "l2e_refresh_level_trmb",
    l2e_refresh_chips = "l2e_refresh_chips",
    l2e_pdg_list = "l2e_pdg_list",
    l2e_draw_chips = "l2e_draw_chips",
    l2e_update_rot_red = "l2e_update_rot_red",
    l2e_update_act_red = "l2e_update_act_red",
    l2e_update_task_red = "l2e_update_task_red",
    l2e_update_mail_red = "l2e_update_mail_red",
    l2e_update_group_red = "l2e_update_group_red",
    l2e_tixian = "l2e_tixian",
    l2e_group_prize = "l2e_group_prize",
    l2e_pop_pmd = "l2e_pop_pmd",
    l2e_close_pmd = "l2e_close_pmd",

    l2e_composite_error = "l2e_composite_error",
    l2e_tixian_error = "l2e_tixian_error",
    l2e_login_error = "l2e_login_error",
    l2e_req_wx_login = "l2e_req_wx_login",
    l2e_update_nickname = "l2e_update_nickname",
    l2e_update_headIcon = "l2e_update_headIcon",
}

export enum S2CProtocol {
    s2c_composite_gold = "s2c_composite_gold",
    s2c_composite_gun = "s2c_composite_gun",
    s2c_group_index = "s2c_group_index",
    s2c_group_rotary = "s2c_group_rotary",
    s2c_group_rotary10 = "s2c_group_rotary10",
    s2c_group_prize = "s2c_group_prize",
    s2c_group_getgx = "s2c_group_getgx",
    s2c_group_friend_list = "s2c_group_friend_list",
    s2c_group_gx_list = "s2c_group_gx_list",
    s2c_list_task = "s2c_list_task",
    s2c_take_task_pri = "s2c_take_task_pri",
    s2c_rotary_pri = "s2c_rotary_pri",
    s2c_7day_info = "s2c_7day_info",
    s2c_7day_pri = "s2c_7day_pri",
    s2c_shop_list = "s2c_shop_list",
    s2c_req_adcode = "s2c_req_adcode",
    s2c_finish_ad = "s2c_finish_ad",
    s2c_enter_stage = "s2c_enter_stage",
    s2c_stage_result = "s2c_stage_result",
    s2c_add_mult = "s2c_add_mult",
    s2c_pdg_list = "s2c_pdg_list",
    s2c_diam_ad = "s2c_diam_ad",
    s2c_list_mail = "s2c_list_mail",
    s2c_mail_prize = "s2c_mail_prize",
    s2c_login = "s2c_login",
    s2c_sync_info = "s2c_sync_info",
    s2c_buy_gun = "s2c_buy_gun",
    s2c_sell_gun = "s2c_sell_gun",
    s2c_exchange_pos = "s2c_exchange_pos",
    s2c_change_weapon = "s2c_change_weapon",
    s2c_free_coin = "s2c_free_coin",
    s2c_exchange_trmb = "s2c_exchange_trmb",
    s2c_use_chips = "s2c_use_chips",
    s2c_take_chip_prize = "s2c_take_chip_prize",
    s2c_tixian = "s2c_tixian",
    s2c_rmb_list = "s2c_rmb_list",
    s2c_pmd_list = "s2c_pmd_list",
    s2c_bind_wx = "s2c_bind_wx",

    s2c_req_gofighting = "s2c_req_gofighting",
    s2c_req_battleresult = "s2c_req_battleresult"
}

interface E2L_LOGIN
{
    e2lProtocol: E2LProtocol;
    name: string;
    pwd: string;
}

interface E2L_ENTER_STAGE
{
    e2lProtocol: E2LProtocol;
    mode: string;
}

export interface L2E_TARGET_DATA {
    l2eProtocol: L2EProtocol;
    pos: cc.Vec2;
    hp: number;
    active: boolean;
    targetId: number;
    targetTypeid: number;
    teamid: number;
    waveid: number;
    move_ruleid: number;
    move_range: string;
    move_dur: number;
    pathid: number;

    shape: number;
    circle: number;
    scale: number;
    stableDur: number;
    destoryDur: number;
    res: string;

}

export interface E2L_TARGET_DESTROY {
    e2lProtocol: E2LProtocol;
    // id: number;
    // teamid: number;
    targetId: number;
    node: cc.Node;
    active: boolean;
}

export interface E2L_TARGET_BOOM {
    e2lProtocol: E2LProtocol;
    node: cc.Node;
    circle: number;
    scale: number;
    score: number;
    totalCircle: number;
}

export interface E2L_TAGERT_KILLED {
    e2lProtocol: E2LProtocol;
    node: cc.Node;
    teamid: number;
    waveid: number;
    targetId: number;
    totalCircle: number;
}

export interface L2E_FIRE_GUN {
    l2eProtocol: L2EProtocol;
    atk: number;
    capacity: number;
    bulletCount: number;

}

export interface L2E_CHECK_BULLET {
    l2eProtocol: L2EProtocol;
    bulletId: number;
    atk: number;
    center: cc.Vec2;

}

export interface L2E_RELOAD_BULLET {
    l2eProtocol: L2EProtocol;
    capacity: number;
    bulletCount: number;
}

export interface E2L_VALID_BULLET {
    e2lProtocol: E2LProtocol;
    bulletId: number;
    circle: number;
    score: number;
    grade: number;

}

export interface C2S_LOGIN {
    token: string;
    device: string;
    game_version: string;
    package_info: string;
    wxcode: string;
}

export interface C2S_QQ_LOGIN {
    token: string;
    device: string;
    machine_id: string;
    game_version: string;
    package_info: string;
    // wxcode: string;
    // encryptedData: string;
    // iv: string;
}

export interface S2C_LOGIN {
    token: string;
    playerId: string;
    nickName: string;
    headIcon: string;

    score: number;                          // 玩家积分
    bl: number;                             // 玩家菠萝数量
    rmb: number;                            // 玩家钱包的金币红包（可以直接提现的）
    trmb: number;                           // 玩家现金券
    minTRmbExchange: number;                // 最低0.3元是否 兑换【0：未兑换；1：已兑换】

    adNum: number;                          //今天观看广告的剩余次数
    sharedNum: number;                      //今天分享的剩余次数
    getRMBNum: number;                      // 提现剩余次数

    myPromoterCode: string;                 //推广码

    loginServerTime: number;

    adGuideCode: number;                    //

    guideStep: number;                      // 引导步骤
    tfAdNum: number;                        // 已观看广告次数
    segmentNum: number;                     // 关卡红包碎片个数
}

export interface L2E_LOGIN {
    nickName: string;
    headIcon: string;
    playerId: number;

    adGuideCode: number;
    // 整菠萝数量，现金券
    trmb: number;
    bl: number;
}

export interface C2S_SYNCINFO {
    token: string;
    viewId: number;
}

export interface L2E_SYNCINFO {

    diamonds: number;                       //玩家钻石
    coin: number;                           //玩家金币

    multNum: number;                        //挂机收益加速券数量

    rotaryNum: number;                      //转盘榜红点; 每日转盘券数量n 【n>1:有红点，n=0:打开则提示看广告获取转盘卷】
    rpActivity: number;                     //活动榜红点
    rpTask: number;                         //任务榜红点
    rpMail: number;                         // 邮件红点
    rpGroup: number;                        // 战队红点

    gunWillBuy:any;                         //推荐购买信息  {"枪械ID":购买价格}

    gunsRMB: any;

}

export interface C2S_BUY_GUN {
    token: string;
    gunId: number;
    payType: number;
    viewId: number;
}

export interface L2E_BUY_GUN {
    gunId: number;
    pos: number;
    // startTime: number;                      //枪械挂机计费时间
    coin: number;                           //玩家身上金币
    addcoin: number;                        //购买的金币
    diamonds: number;                       //购买的钻石
    adddiamonds: number;                    //玩家身上钻石
    adGuideCode: number;                    //是否广告升级【0:无； 400：看广告升级；100：金币不足】

    gunWillBuy: any;                        //推荐购买信息  {"枪械ID":购买价格}
    viewId: number;
}

export interface E2L_POP_COIN {
    gridPos: number;
    count: number;
}

export interface COM_PAIR {
    key: string;
    value: string;
}

export interface L2E_SELECT_GUN {
    gridPos: number;
    gunId: number;
    gunLv: number;
    // sprite: cc.SpriteFrame;
    sptRes: string;
    startPos: cc.Vec2;
}

export interface C2S_SELL_GUN {
    token: string;
    pos: number;
}

export interface L2E_SELL_GUN {
    pos: number;
    coin: number;
    addcoin: number;
    gunWillBuy: any;
}

export interface C2S_EXCHANGE_POS {
    token: string;
    pos: number;
    posTo: number;
}

export interface L2E_EXCHANGE_POS {
    pos: number;
    posTo: number;
}

export interface C2S_COMPOSITE_GUN {
    token: string;
    pos1: number;
    pos2: number;
}

export interface S2C_COMPOSITE_GUN {
    gunId: number;
    pos: number;
    pos1: number;
    pos2: number;
    coin: number;
    gunWillBuy: any;
    gunFight: number;

    maxLv: number;
    adGuideCode: number;
    adGuideData: number;

    gunchip: any;
}

export interface L2E_COMPOSITE_GUN {
    gunId: number;
    pos: number;
    pos1: number;
    pos2: number;
    coin: number;
    gunWillBuy: any;
    gunFight: number;

    maxLv: number;
    adGuideCode: number;
    adGuideData: number;
    gunchip: any;
}

export interface C2S_CHANGE_WEAPON {
    token: string;
    pos: number;
}

export interface L2E_CHANGE_WEAPON {
    gunId: number;
}

export interface C2S_COMPOSITE_GOLD {
    token: string;
}

export interface S2C_COMPOSITE_GOLD {
    // gunId: number;
    pdgNum: number;
    coin: number;
    gunWillBuy: any;
}

export interface L2E_COMPOSITE_GOLD {
    otherGuns: any;
}


export interface C2S_GROUP_INDEX {
    token: string;
    type: number;
}

export interface C2S_GROUP_GETGX {
    token: string;
}

export interface S2C_GROUP_INDEX {
    fatherId: number;                       //我的队长：【0:没有队长；>0：队长ID】
    fatherName: string;
    gLv: number;                            //战队级别
    sonNum: number;                         //战队所有小队长
    sonANum: number;                        //战队所有激活小队长
    contribute: number;                     //玩家身上的贡献点
    gMaxNum: number;                        //战队级别最大人数

    myGX: number;                           //自己的待领取贡献
    sGX: number;                            //队长的待领取贡献
    gsGX: number;                           //队员的待领取贡献

    //grCount: number;                        //战队转盘  当前次数
    //grCountT: number;                       //战队转盘  目标次数

    payRotary1: number;                     //转盘1次消耗的贡献
    payRotary10: number;                    //转盘10连抽消耗的贡献

    curtrCount:number, //当前抽奖次数
    trCount:number, //目标抽奖次数
}


export interface C2S_GROUP_ROTARY {
    token: string;
    ticketType: number;
}

export interface S2C_GROUP_GETGX {
    type:number,			//
    contribute:number,		//玩家身上的贡献点
}

export interface S2C_GROUP_ROTARY {
    ticketType: number;
    point: number;
    diamonds: number;
    adddiamonds: number;
    contribute:number,		//玩家身上的贡献点
    addcontribute:number,	//玩家身上 变化的贡献点（转盘消耗的贡献点）
    rmb:number,				//玩家身上的红包（直接提现）
    addrmb:number,			//奖励红包
    curtrCount:number, //当前抽奖次数
    trCount:number, //目标抽奖次数
}
export interface S2C_GROUP_PRIZE {
    rmb:number,				//玩家身上的红包（直接提现）
    addrmb:number,			//奖励红包
    trCount:number, //目标抽奖次数
    curtrCount:number, //当前抽奖次数
}
export interface S2C_GROUP_ROTARY10 {
    ticketType: number;
    diamonds: number;
    adddiamonds: any;
    contribute:number,		//玩家身上的贡献点
    addcontribute:number,	//玩家身上 变化的贡献点（转盘消耗的贡献点）
    rmb:number,				//玩家身上的红包（直接提现）
    addrmbs:any,			//奖励红包
    curtrCount:number, //当前抽奖次数
    trCount:number, //目标抽奖次数
}

export interface C2S_LIST_TASK {
    token: string;
}

export interface S2C_LIST_TASK {
    hasTakeD: number[];
    finishTakeD: any;
}

export interface C2S_TAKE_TASK_PRI {
    token: string;
    id: number;
}

export interface S2C_TAKE_TASK_PRI {
    taskId: number;                             // 任务Id
    gunId: number;
    gunPos: number;                         // 枪械位置【-1:黄金或平底锅; 1~12:场上位置； 100:发送到邮件领取】
    diamonds: number;
    adddiamonds: number;
    coin: number;
    addcoin: number;
    trmb: number;
    addTicketRMB: number;
    addGX: number;
    gunWillBuy: any;
}
export interface L2E_UPD_GOLD_GUN {
    otherGuns: any;
}
export interface L2E_UPD_ONE_SITE_GUN {
    gunId: number;
    gunPos: number;
}

export interface L2E_COMMON_NUM {
    val: number;
}

export interface C2S_ROTARY_PRI {
    token: string;
    ticketType: number;
}

export interface S2C_ROTARY_PRI {
    ticketType: number;
    point: number;
    mult: number;
    gunId: number;
    gunPos: number;
    diamonds: number;
    adddiamonds: number;
    coin: number;
    addcoin: number;
    gunWillBuy: any;
}

export interface L2E_CONSUME_ROT {
    ticketType: number;
    point: number;
    mult: number;

    gunId: number;
    gunPos: number;
    adddiamonds: number;
    addcoin: number;
    gunWillBuy: any;
}

export interface L2E_CONSUME_ROTAD {
    rotaryNum: number;
    rotaryAdNum: number;
}

export interface C2S_7DAY_INFO {
    token: string;
}

export interface S2C_7DAY_INFO {
    prizeDay: number;	                        //当前到第几天奖励；【从1开始】
    hasTake: number;		                    //当前奖励是否已经领取 [0：未领取； 1：已领取]
}

export interface C2S_7DAY_PRI {
    token: string;
}

export interface S2C_7DAY_PRI {
    gunId: number;
    gunPos: number;
    diamonds: number;
    adddiamonds: number;
    coin: number;
    addcoin: number;
    gunWillBuy: any;
}

export interface L2E_7DAY_PRI {
    gunId: number;
    adddiamonds: number;
    addcoin: number;
}

export interface C2S_SHOP_LIST {
    token: string;
}

export interface S2C_SHOP_LIST {
    buyGunHistory: any;
    serverTime: number;
}

export interface C2S_REQ_AD_CODE {
    token: string;
    adGuideCode: number;
    adGuideData: number;
    type: number;               // 0:广告，1：分享
}

export interface S2C_REQ_AD_CODE {
    adGuideCode: number;
    // adNum: number;
    // adMultNum: number;
    // adRotaryNum: number;
    // sharedNum: number;                  //今天分享的剩余次数
    // adType: number;                     // 0:广告，1：分享

}

export interface C2S_FINISH_AD {
    token: string;
}

export interface S2C_FINISH_AD {
    finishdAdCode: number;

    trmb: number;
    addtrmb: number;

    adNum: number;
    tfAdNum: number;                        // 已观看广告次数
    
    serverTime: number;
}

export interface L2E_SHOP_FINISH_AD {
    gunId: number;
    freeGunCD: number;
}

export interface C2S_ENTER_STAGE {
    token: string;
    battleType: number;
    id: number;
}

export interface S2C_ENTER_STAGE {
    stageId: number;
    stageMode: number;
}
export interface L2E_ENTER_STAGE {
    stageId: number;
    stageMode: number;
}

export interface C2S_STAGE_RESULT {
    token: string;
    win: number;
    score: number;
}

export interface S2C_STAGE_RESULT {
    stageId: number;
    win: number;
    diamonds: number;
    adddiamonds: number;
    coin: number;
    addcoin: number;
    brcoin: number;
}

export interface L2E_STAGE_RESULT {
    stageId: number;
    win: number;
    adddiamonds: number;
    addcoin: number;
}

export interface C2S_ADD_MULT {
    token: string;
}

export interface S2C_ADD_MULT {
    multTT: number;
    multCountdown: number;
    mult: number;
    multNum: number;
    serverTime: number;
}

export interface L2E_UPDATE_MULT {
    multTT: number;
    multCountdown: number;
    mult: number;
    multNum: number;
    serverTime: number;
}

export interface C2S_PDG_LIST {
    token: string;
}

export interface S2C_PDG_LIST {
    data: any;
}

export interface C2S_DIAM_AD {
    token: string;
}

export interface S2C_DIAM_AD {
    diamonds: number;
    adddiamonds: number;
    coin: number;
    addcoin: number;
}

export interface TIP_INFO {
    dur: number;
    type: number;
    resPath: string;
    count: number;
    tip: string;
}

export interface C2S_LIST_MAIL {
    token: string;
    page: number;
    size: number;
}


export interface C2S_READ_MAIL {
    token: string;
    id: string;
}

export interface C2S_MAIL_PRIZE {
    token: string;
    id: string;
}

export interface S2C_MAIL_PRIZE {
    mailId: string;
    diamonds: number;
    coin: number;
    adddiamonds: number;
    addcoin: number;
    gunsInfo: any;
}

export interface L2E_MAIL_PRIZE {
    mailId: string;
}

export interface C2S_FREE_COIN {
    token: string;
    type: number;
}

export interface S2C_FREE_COIN {
    freeCoinBuff: number;                   //ad code 【900：2分钟漂浮金币空投箱；901：5分钟漂浮金币空投箱】
    freeCoinCD: number;                     //冷却时间(秒)
    freeCoinLive: number;                   //生命时长(秒)
}

export interface L2E_FREE_COIN {
    freeCoinCD: number;                     //冷却时间(秒)
    freeCoinLive: number;                   //生命时长(秒)
}

export interface C2S_WORLD_RANK {
    token: string;
    type: number;
}

export interface L2E_WORLD_RANK {
    rankListData: any;
}

export interface C2S_UPDATE_WX_INFO {
    token: string;
    nickName: string;
    headIcon: string;
}

export interface C2S_EXCHANGE_TRMB {
    token: string;
    trmb: number;
}

export interface S2C_EXCHANGE_TRMB {
    trmb: number;
    addtrmb: number;
    rmb: number;
    addrmb: number;
}

export interface C2S_USE_CHIPS {
    token: string;
    chipType: number;
}

export interface S2C_USE_CHIPS {
    gunchip: any;
    gunList: any;
}

export interface C2S_TAKE_CHIP_PRIZE {
    token: string;
    type: number;
}

export interface S2C_TAKE_CHIP_PRIZE {
    type: number;
    rmb: number;
    addrmb: number;
}

export interface C2S_CHIP_LIST {
    token: string;
    gunType: number;
}

export interface L2E_CHIP_LIST {
    data: any;
}

export interface C2S_LIST_GROUP_FRIENDS {
    token: string;
    friendType: number;
    page: number;
    size: number;
}

export interface S2C_LIST_GROUP_FRIENDS {
    friendType: number;
    total: number;
    data: any;
}

export interface C2S_LIST_GX_RECORD {
    token: string;
    time: number;
    page: number;
    size: number;
}

export interface S2C_LIST_GX_RECORD {
    total: number;
    data: any;
}

export interface C2S_TIXIAN {
    token: string;
    amount: number;
}

export interface S2C_TIXIAN {
    rmb: number;
    addrmb: number;
}

export interface C2S_RMB_HISTORY {
    token: string;
    page: number;
    size: number;
}

export interface S2C_RMB_HISTORY {
    total: number;
    data: any;
}

export interface C2S_PMD {
    token: string;
}

export interface C2S_BIND_WX {
    token: string;
    code: string;
}

export interface S2C_BIND_WX {
    nickName: string;
    headIcon: string;
}